package com.liang.mapper;

import com.liang.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@SuppressWarnings("all")
public interface UserMapper {

    @Insert("insert into club.student (name,pwd,code,teacherId) values (#{name},#{pwd},#{code},#{teacherId})")
    int insertUser(@Param("name") String name,@Param("pwd") String pwd,@Param("code") String code,@Param("teacherId") int teacherId);

    @Delete("delete from club.student where id=#{id}")
    int deleteUser(Integer id);

    @Update("update club.student set name=#{name} where id=#{id}")
    int updateUserName(@Param("name") String name,@Param("id") Integer id);
    @Select("select * from club.student where code like concat('%',#{code},'%')")
    List<User> getUserList(@Param("code") String code);

    @Select("select * from club.student where id=#{id}")
    User getUserById(@Param("id") Integer id);
}
